<?php

defined('o') || exit('404 not find file'); //防跳墙
class goodsx extends model{
	public function addgoods($name,$class,$type,$user,$image = 'default.png'){
		return $this->adddata(array(
			'goods_name'=>	$name,
			'goods_image'=> $image,
			'goods_type'=>$type,
			'goods_class'=>$class,
			'goodsx_ex'=>0,
			'user_id'=>$user
			));
	}

	public function selectdata($goods_class,$goods_name){
		return $this->querydata(array('goods_id')," where goods_class=$goods_class and goods_name='$goods_name'");
	} 

	public function examine($name){
		$temp = $this->query("select goods_name,goods_image,goods_type,goods_class,goods_keymodel from xxx_goodsx where goods_name ='$name'",array(),$count);
		if ($temp) {
			return $this->query("insert into xxx_goods (goods_name,goods_image,goods_type,goods_class,goods_keymodel) select goods_name,goods_image,goods_type,goods_class,goods_keymodel from xxx_goodsx where goods_name ='$name'",array(),$count);
		}
		return false;
		
	}
}


?>